/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.rolgps.libnstack.message;

/**
 *
 * @author xeph
 */
@SuppressWarnings("unchecked")
public class DBMessage extends GenericMessage{

    /**
     *
     */
    public DBMessage() {
        this.addHeader("type", "DB");
    }

    /**
     *
     * @param key
     */
    public void key(String key){
        this.addTuple("key", name);
    }
    /**
     *
     * @param criteria
     */
    public void filter(String criteria){
        this.addTuple("filter", criteria);
    }

    /**
     *
     * @return
     */
    public String[] getFilters(){
        return getTuple("filter");
    }

    /**
     *
     * @param key
     * @return
     */
    public String[] getPairs(String key){
        String[] result = new String[0];
                result = this.getTuple("key:"+key);
        return result;
    }
    /**
     *
     * @param key
     * @param value
     */
    public void addPair(String key, String value){
        this.addTuple("key:"+key, value);
    }


}
